<template>
  <el-table :data="shList" style="width: 100%; padding: 15px">
    <el-table-column label="待审核页面" prop="reviewName" min-width="200">
      <!-- <template slot-scope="scope">
        {{ scope.row.order_no | orderNoFilter }}
      </template> -->
    </el-table-column>
    <el-table-column label="待审核数量" prop="unreviewCount" width="295" align="center">
      <!-- <template slot-scope="scope">
        ¥{{ scope.row.price | toThousandFilter }}
      </template> -->
    </el-table-column>
    <el-table-column label="操作" prop="url" width="200" align="center">
      <template slot-scope="scope">
        <el-button @click="$router.push(scope.row.url)" type="text">审核</el-button>
        <!-- <el-link :href="scope.row.url">审核</el-link> -->
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { transactionList } from "@/api/remote-search";
import gztApi from '@/api/gzt';

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        success: "success",
        pending: "danger",
      };
      return statusMap[status];
    },
    orderNoFilter(str) {
      return str.substring(0, 30);
    },
  },
  data() {
    return {
      list: [
        {
          order_no: "Cb9D97F6-CF9c-9C47-F7cC-64539bDed51f",
          price: 6582,
          status: "pending",
          timestamp: 1390022144108,
          username: "Scott Moore",
        },
        {
          order_no: "5D4E6B7f-5Ad2-3EA8-86FB-EF8d7A7CC5CA",
          price: 8250,
          status: "pending",
          timestamp: 1390022144108,
          username: "Richard Brown",
        },
        {
          order_no: "9029d27D-fc9F-beb9-9C8A-Be94eAAC1E85",
          price: 9383,
          status: "success",
          timestamp: 1390022144108,
          username: "Carol Williams",
        },
        {
          order_no: "4eBFECB4-7Afa-dbA0-6c74-7b8A166aF7A2",
          price: 12819.2,
          status: "pending",
          timestamp: 1390022144108,
          username: "Linda Anderson",
        },
        {
          order_no: "53BCBb50-0C35-2B2d-e242-Bb2Ff93A28b1",
          price: 11512,
          status: "success",
          timestamp: 1390022144108,
          username: "Mary Walker",
        },
        {
          order_no: "ef123274-fb57-1D55-A60f-9FcCC62a5cDd",
          price: 7958,
          status: "success",
          timestamp: 1390022144108,
          username: "Amy Hall",
        },
        {
          order_no: "6BBd9bf5-8A64-ef34-25Bf-A5e8eDAD2FC5",
          price: 9210.2,
          status: "success",
          timestamp: 1390022144108,
          username: "Lisa Martin"
        },
        {
          order_no: "8F69c2EF-110E-A3be-3bE6-7CAc90c90A06",
          price: 7654.4,
          status: "success",
          timestamp: 1390022144108,
          username: "Donald Lewis"
        },
      ],
      shList:[],
    };
  },
  created() {
    // this.fetchData()
  },
  mounted(){
    this.getList();
  },
  methods: {
    //获取待审核列表
    async getList(){
      //发送查询请求
      let res = await gztApi.getList();
      //判断是否成功
      if(res.success){
        console.log(res.data);
        // let count = 0;
        // for(let i=0; i<res.data.length; i++){
        //   count = count + Number(res.data[i].unreviewCount);
        // }
        // this.total = count
        // console.log(this.total);

        this.shList = res.data
        //赋值
        // this.tableData = res.data.records;
        //总数量
        // this.total = res.data.total;
      }
    }
  }
    // fetchData() {
    //   transactionList().then(response => {
    //     this.list = response.data.items.slice(0, 8)
    //   })
    // }

};
</script>
